package com.pos.dao.impl;

import com.pos.dao.DishDAO;
import com.pos.pojo.Dish;
import org.springframework.orm.hibernate5.HibernateTemplate;

import java.util.List;

public class DishDAOImpl extends HibernateTemplate implements DishDAO {
    @Override
    public List<Dish> list() {
        return (List<Dish>) find("from com.pos.pojo.Dish ");
    }

    @Override
    public void add(Dish dish) {
        save(dish);
    }

    @Override
    public void delete(Dish dish) {
        super.delete(dish);
    }

    @Override
    public Dish get(int dish_id) {
        return (Dish) get(Dish.class,dish_id);
    }

    @Override
    public void update(Dish dish) {
        super.update(dish);
    }
}
